import { Meta } from '@storybook/addon-docs';

<Meta
  title="Docs/Hacking/4. Release Process"
  parameters={{
    viewMode: 'docs',
    previewTabs: { canvas: { hidden: true } },
    canvas: { disable: true },
  }}
/>

# Release Process

Github Actions is used along with goreleaser for releases. This document is used to track the manual processes that occur during a release process.

## Update version

The version is tracked by a build.go file though `go run build.go version`. Update this to the next version then commit the changes.

## Generate Changelogs

Each pull request should have a changelog entry in `/changelogs/unreleased`. Run `bash hacks/changelogs` to condense each change into a single console output. Update for formatting and editing as needed.

Follow the console output and remove old changelog entries. Then create the new changelog file in the format `CHANGELOG-X.Y.md`.

Finally, add the new changelog file under `CHANGELOG.md`.

## Trigger a Release

Once the above steps are completed, a user with write access to the repository will need to tag a commit then push the tag.

```go
go run build.go release
```

The release pipeline will trigger. If there are no errors, goreleaser will draft a release.

## Publish Release

Navigate to the releases page on Github. There should be a release in draft.

Remove the autogenerated commit log and replace with the one generated by the build.

After the release notes are updated, click `Publish release`.

## Update Package Managers

### chocolatey

Updating Octant's version for chocolatey requires an account with maintainer status on [https://chocolatey.org/packages/octant](https://chocolatey.org/packages/octant) and an installation of chocolatey.

**Note**: There is a script to handle steps 1 - 5 by running `./choco/update.sh` from the project root.

1. Navigate to `/choco`. Open `/tools/chocolateyinstall.ps1` with a text editor.

2. Edit `$url64` to include the current release version for the URL path and binary zip file name.

3. Update `$checksum64` with the current checksum.

4. Open `octant.nuspec` with a text editor.

5. Updated the version tag to the current version.

6. Run `choco pack octant.nuspec`. This will generate a `.nupkg` file to be uploaded.

7. On [https://chocolatey.org/packages/octant](https://chocolatey.org/packages/octant), click `Edit Package` on the left sidebar. Upload the generated `.nupkg` file.

8. The package will go through a series of automated checks and manual maintainer review before becoming the default version.

### scoop

Scoop updates are handled by automation from the scoop maintainers.

### homebrew

Homebrew updates are handled by automation from the homebrew maintainers.

